package com.jotta.client.data;

import com.jotta.client.R;

public class DeviceInfo extends ItemInfo {
	private TypeOfDevice typeOfDevice = TypeOfDevice.WORKSTATION;
	
	public DeviceInfo() {
		super();
		setType(TypeOfItem.DEVICE);
	}

	/**
	 * @param typeOfDevice the typeOfDevice to set
	 */
	public void setTypeOfDevice(TypeOfDevice typeOfDevice) {
		this.typeOfDevice = typeOfDevice;
	}

	/**
	 * @return the typeOfDevice
	 */
	public TypeOfDevice getTypeOfDevice() {
		return typeOfDevice;
	}
	
	@Override
	public int getImageResourceId(){
		int code = R.drawable.workstation;
		if(typeOfDevice == TypeOfDevice.IMAC)
			code = R.drawable.imac;
		else if(typeOfDevice == TypeOfDevice.JOTTA)
			code = R.drawable.archive;
		else if (typeOfDevice == TypeOfDevice.LATOP)
			code = R.drawable.laptop;
		else if(typeOfDevice == TypeOfDevice.MACBOOK)
			code = R.drawable.macbook;
		else if(typeOfDevice == TypeOfDevice.MACMINI)
			code = R.drawable.macmini;
		else if(typeOfDevice == TypeOfDevice.MACPRO)
			code = R.drawable.macpro;
		else if(typeOfDevice == TypeOfDevice.WORKSTATION)
			code = R.drawable.workstation;
		return code;
	}

	public void setTypeOfDevice(String deviceType) {
		if(deviceType.equals("IMAC"))
			typeOfDevice = TypeOfDevice.IMAC;
		else if(deviceType.equals("WORKSTATION"))
			typeOfDevice = TypeOfDevice.WORKSTATION;
		else if(deviceType.equals("LATOP"))
			typeOfDevice = TypeOfDevice.LATOP;
		else if(deviceType.equals("MACBOOK"))
			typeOfDevice = TypeOfDevice.MACBOOK;
		else if(deviceType.equals("MACMINI"))
			typeOfDevice = TypeOfDevice.MACMINI;
		else if(typeOfDevice.equals("MACPRO"))
			typeOfDevice = TypeOfDevice.MACPRO;		
	}
}
